<?php
  require_once "includes/config.php";

  $sqlDraft="select * from tbl_drafts";
  $exeDraft=mysql_query($sqlDraft) or die(mysql_error());
  while($arrDraft=mysql_fetch_array($exeDraft))
  {
     $draft_date=strtotime(str_replace('Draft_','',$arrDraft['draft_name']));
	 //echo date("Y-m-d", $draft_date);
	 //echo '<br>';
	 $thirty_days_after_post_day=($draft_date+(30*24*60*60));
	 //echo date("Y-m-d", $thirty_days_after_post_day);
	 //echo '<br>';
     $today=time();
	 if($thirty_days_after_post_day<$today)
	 {
	    mysql_query("delete from tbl_drafts where draft_id='".$arrDraft['draft_id']."'") or die(mysql_error());
	}
  }

?>